package reproductores;

import java.io.IOException;

public class OtroReproductor {

	public static void encolar(boolean solamenteEncolar, boolean unSoloTema, String url, String primerTema, String otroReproductor, String encolarTema, String encolarLista, String encolarTemaReproducir, String encolarListaReproducir) {
		
		if (solamenteEncolar) {
				
			if (unSoloTema) {
				String[] commandLin = new String[]{otroReproductor, encolarTema , url};
					
				try {
					//System.out.println(commandLin[0] + " " + commandLin[1] + " " + commandLin[2]);
					@SuppressWarnings("unused")
					Process procesoLin;
					procesoLin = Runtime.getRuntime().exec(commandLin, null, null);
				}
				catch (Exception e) {
					e.printStackTrace();
				}
			}
			else {
				String[] commandLin = {"bash", "-c", otroReproductor + " " + encolarLista + " " + url};
				//System.out.println(commandLin[0] + " " + commandLin[1] + " " + commandLin[2]);
					
				try {
					Runtime.getRuntime().exec(commandLin);
				} catch (IOException e) {
					e.printStackTrace();
				} 
			}
		}
		else {
				
			if (unSoloTema) {
				
				String[] commandLin = new String[]{otroReproductor, encolarTemaReproducir , url};
				try {
					//System.out.println(commandLin[0] + " " + commandLin[1] + " " + commandLin[2]);
					@SuppressWarnings("unused")
					Process procesoLin;
					procesoLin = Runtime.getRuntime().exec(commandLin, null, null);
				}
				catch (Exception e) {
					e.printStackTrace();
				}
			}
			else {
				String[] mocp = {"bash", "-c", otroReproductor + " " + encolarListaReproducir  + " " + url};
				//System.out.println(mocp[0] + " " + mocp[1] + " " + mocp[2]);
				try {
					Runtime.getRuntime().exec(mocp);
				} catch (IOException e) {
					e.printStackTrace();
				} 
			}
		}
	}
}

